<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-3.4.1.js"></script>
    <script>
        $(function () {
            $.get("/dept/findAll",function(data){
                console.log(data);
                $("#tbody").html("");
                $.each(data,function (index,obj) {
                    var tr = "<tr>" +
                        "<td>"+obj.deptno+"</td>" +
                        "<td>"+obj.dname+"</td>" +
                        "<td>"+obj.loc+"</td>" +
                        "<td><img style='height: 50px' width='50px' src='"+obj.imgpath+"'></td>" +
                        "</tr>";
                    $("#tbody").append(tr);
                });

            },"json");
        });
    </script>
</head>
<body>
    列表
<table>
    <thead>
        <tr>
            <th>编号</th>
            <th>名称</th>
            <th>地址</th>
            <th>图片</th>
        </tr>
    </thead>
    <tbody id="tbody"></tbody>
</table>
</body>
</html>